LGF_StringToDTL_US (FC / 1.0.0)

Overview

Author: Siemens Digital Industry

Short description

This function converts a character string in American format (US) with date and time components into the data type DTL.

Block Interface

LGF_StringToDTL_US (FC)
String  date Ret_Val  DTL
    
   error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
dateString Date as a character string according to the format.
Example: `01-22-2019 14:07:57.696417000`.

Output parameter

IdentifierData type Description
Ret_ValDTL
errorBool FALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_FINISHED_NO_ERROR
Status: Execution finished without errors
16#7000STATUS_NO_JOB
Status: No current job processed
16#8201ERR_FORMAT_YEAR
Error: YEAR out of range of DTL - YEAR value does not correspond to the format or specification (outside the value range of DTL)
16#8202ERR_FORMAT_MONTH
Error: MONTH out of range of DTL - MONTH value does not correspond to the format or specification (outside the value range of DTL)
16#8203ERR_FORMAT_DAY
Error: DAY out of range of DTL - DAY value does not correspond to the format or specification (outside the value range of DTL)
16#8204ERR_FORMAT_HOUR
Error: HOUR out of range of DTL - HOUR value does not correspond to the format or specification (outside the value range of DTL)
16#8205ERR_FORMAT_MINUTE
Error: MINUTE out of range of DTL - MINUTE value does not correspond to the format or specification (outside the value range of DTL)
16#8206ERR_FORMAT_SECOND
Error: SECOND out of range of DTL - SECOND value does not correspond to the format or specification (outside the value range of DTL)
16#8207ERR_FORMAT_NANOSECOND
Error: NANOSECOND out of range of DTL - NANOSECOND value does not correspond to the format or specification (outside the value range of DTL)
16#8400ERR_DATE_STRING_EMPTY
Error: Input String `date` is empty
16#8401ERR_DATE_STRING_TO_SHORT
Error: Input String `date` is too short - minimum is 'MM-DD-YYYY HH:MM:SS'

Functional description

The block reads a date as a character string and converts it to the data type DTL. The individual date components in the character string are separated according to the American format. The separator between the components in the character string is irrelevant.

American format (US):

LGF_DTLToString_US - Structure of the character string in accordance with American format

Change log

Version & DateChange description
1.0.0Siemens Industry Online Support
28.07.2025First released version